﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Lotto
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Page.IsPostBack)
            {
                string result = "";
                result += TextBox0.Text;
                result += TextBox1.Text;
                result += TextBox2.Text;
                result += TextBox3.Text;
                result += TextBox4.Text;
                result += TextBox5.Text;
                result += TextBox6.Text;

                List<string> li = ViewState["result"] as List<string>;

                if (li == null)
                {
                    li = new List<string>();
                }

                li.Add(result);
                
                ViewState["result"] = li;
                foreach (string s in li)
                {
                    uiResult.Controls.Add(new Label() { Text = s});
                }
                
                Person P = ViewState["Person"] as Person;
                if (P == null)
                {
                    P = new Person();
                    P.Name = "<strong>P "+result+" P</string>";
                }
                ViewState["Person"] = P;
                form1.Controls.Add(new LiteralControl(P.Name));
            }
        }
    }
    [Serializable]
    class Person
    {
        public string Name { get; set; }
    }
}